//! Header for the Extras class
#ifndef EXTRAS_H
#define EXTRAS_H

#include "Object.h"
#include "ICar.h"

//! Extras is the Base class for all concrete extras
/*!
Extras is the base class for the conrete decorators in
terms of design patterns.
\class Extras
\author Thomas Pfeiffer
\date 20.12.2012
*/
class Extras : public Object, public ICar {
public:

	//! CTor of the extras class
	/*!
	The CTor of the extras class. Initializes the Car it decorates.
	\param car An Object which implements ICar that should be decorated.
	\throws std::exception if car is null
	*/
	Extras ( ICar * car);

	//! The DTor of the Extras.
	/*!
	The DTor frees the components and other decorators
	it decorates.
	*/
	virtual ~Extras();

	//! Prints the Car and its decorators
	/*!
	In terms of designpatterns this function is a template method.
	It calls print of the car it decorates and then prints itself.
	Where the printing of itself is the operation which is called
	by the template method.
	\param out The stream you want to print into.
	*/
	void Print (std::ostream & out) const;

	float GetPrice() const;

	std::string const& GetManufacturer() const;

	std::string const& GetType() const;

protected:
	//! Prints the Text of the extra.
	/*!
	This function is the operation which is called by the template
	method.
	\param out The stream you want to print into.
	*/
	virtual void DoPrint(std::ostream & out) const = 0;

	//! The Car/Extra this Decorator decorates.
	ICar * mCar;

	//! The Price of an Extra
	float mPrice;
};

#endif